<template>
	<view class="component">
		<!-- <view class="title">
      <view class="label">客户评价 <text style="font-size: 26rpx;">({{ dataSource.length || 0 }})</text></view>
      <view class="more">
        <uni-icons type="forward" size="18"></uni-icons>
      </view>
    </view> -->
		<view class="content">
			<view class="evaluation">
				<view class="comment-item" v-for="(item, index) of dataSource" :key="index">
					<image :src="item.avatar" class="comment-item-avatar"></image>
					<view class="comment-item-right">
						<view style="margin-bottom: 14rpx; display: flex; flex-direction: row;align-items: flex-end;justify-content: flex-start;">
							<view class="comment-item-right__name">{{item.username?item.username:'游客'}}
							</view>
							<view style="margin-bottom: 5rpx; margin-left: 5rpx; font-size: 20rpx; color: rgb(153, 153, 153);">{{item.gender}}</view>
						</view>
						<view class="comment-item-right__desc" v-if="item.content">
							<view style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start;" v-if="item.content == '点赞'">
								<view style="font-size: 26rpx; color: red;">{{item.content}}</view>
								<image style="margin-left: 10rpx; width: 40rpx; height: 40rpx;" :src="item.zan_url"></image>
							</view>
							<view v-else>
								{{item.content}}
							</view>
						</view>
						<view class="comment-item-right__imgBox"
							v-if="item.images && item.images.length > 0 && item.images[0] != ''">
							<image class="comment-item-right__imgItem" :src="img" v-for="(img,idx) in item.images"
								:key="idx">
							</image>

						</view>
						<view class="comment-item-right__time">{{item.createtime}}</view>
					
					</view>
				</view>
			</view>
			<view v-if="isEmpty" class="" style="padding-top: 80rpx; box-sizing: border-box;">
				<StEmpty>暂无客户评价</StEmpty>

			</view>
			
		</view>
	</view>
</template>
<script>
	import StEmpty from '@/components/st-empty/st-empty.vue';
	export default {
		components: {
			StEmpty,
		},
		props: {
			dataSource: {
				type: Array,
				default: () => []
			},
			isEmpty: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {

			}
		},
		computed: {

		},
		watch: {

		},
		mounted() {

		},
		methods: {

		}
	};
</script>
<style lang='less' scoped>
	.component {
		width: 100%;
		height: 100%;
		background-color: #fff;

		.title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 30rpx;
			height: 90rpx;

			.label {
				font-size: 32rpx;
				color: #333;
				font-size: 15px;
				line-height: 18px;
			}

			.more {
				font-size: 28rpx;
				color: #999;
			}
		}

		.content {
			padding: 0 32rpx 30rpx;
		}
	}

	.evaluation {
		.comment-item {
			width: 100%;
			padding: 30rpx 0rpx 30rpx 0rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: row;
			align-items: flex-start;
			justify-content: flex-start;
			
			border-bottom: 1px solid rgb(238, 238, 238);

			.comment-item-avatar {
				width: 90rpx;
				height: 90rpx;
				border-radius: 45rpx;
				margin-right: 16rpx;
				background-color: rgb(230, 230, 230);
			}

			.comment-item-right {
				flex: 1;
				position: relative;
				

				&__name {
					max-width: 350rpx;
					font-size: 28rpx;
					color: rgb(153, 153, 153);
				}

				&__desc {
					font-size: 28rpx;
					color: #000;
					text-align: left;
					margin-bottom: 16rpx;
				}

				&__imgBox {
					display: flex;
					flex-direction: row;
					align-items: center;
					justify-content: flex-start;
					margin-bottom: 16rpx;
				}

				&__imgItem {
					width: 180rpx;
					height: 180rpx;
					border-radius: 10rpx;
					margin-right: 12rpx;
					background-color: rgb(230, 230, 230);
				}

				&__time {
					position: absolute;
					right: 0rpx;
					top: 0rpx;
					font-size: 24rpx;
					color: rgb(153, 153, 153);
				}

/* 				&__line {
					margin-top: 30rpx;
					width: 100%;
					height: 1px;
					background-color: rgb(238, 238, 238);

				} */
			}
		}
		.comment-item :last-child {
			&__line {
				margin-top: 30rpx;
				width: 100%;
				height: 1px;
				background-color: rgba(238, 238, 238, 0);

			}
		}
	}
</style>